<template>
    <list-page
        :pager="pager"
        :data="projectData"
        :showSelectSearch="false"
        :showSelectTips="false"
        :placeholder="placeholder"
        @searchByKey="searchByKey"
        @searchReset="searchReset"
        @selectionChange="selectionChange"
        @changePageSize="changePageSize"
        @changeCurrentPage="changeCurrentPage">
        <template slot="table">
            <el-table
                :data="projectData"
                align="center"
                ref="multipleTable">
                <el-table-column label="序号" width="60" prop="index"></el-table-column>
                <el-table-column label="负责项目名称" prop="projectName"></el-table-column>
                <el-table-column label="项目状态" prop="projectType"></el-table-column>
                <el-table-column label="项目开始日期" prop="projectStartDate"></el-table-column>
                <el-table-column label="项目结束日期" prop="projectEndDate"></el-table-column>
                <el-table-column label="项目介绍日期" prop="projectIntroductDate"></el-table-column>
            </el-table>
        </template>
    </list-page>
</template>

<script>
    import pager from '@/assets/vue-mixin/pager'
    import {get} from "~/utils/dbl"
    import {mapState} from 'vuex'
    export default {
        name: "project-info",
        mixins: [pager],
        props: {
            pid: {
                type: String
            },
        },
        data(){
            return{
                projectData:[],
                searchDataFrom: {},
                placeholder:"请输入负责项目名称"
            }
        },
        methods:{
            getListData(){
                this.projectData=[{
                    projectName:'XXXXXX',
                    projectType:'完工',
                    projectStartDate:'2020-7-7',
                    projectEndDate:'2020-12-30',
                    projectIntroductDate:'2020-12-30'
                }]

                // fetchList(Object.assign({}, this.pageParams, this.searchForm)).then(resp => {
                //     this.contractData=resp.data.data.records
                //     this.setListData(resp.data)
                // })
            },
            searchReset() {
                // console.log("====searchReset")
                //清空选中的数据
                this.searchForm = {}
                //重新查询
                this.resetList()
            },
            searchByKey(val) {
                // console.log('searchByKey', this.searchDataFrom);
                //qh+:模糊查询
                // alert("搜索值为："+val);
                //获取输入的值
                if(val){
                    this.searchForm.projectName=val;
                }else {
                    delete this.searchForm.projectName
                }
                this.resetList()
            },

        }
    }
</script>

